﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ModelLayer;
using DBLayer;

namespace CtrLayer
{
    public class PersonController
    {
        private IPersonDB perDb = new PersonDBClient();

        public Person CreatePerson(String fName, string lName, string telephone)
        {
            return new Person(fName, lName, telephone);
        }

        public int InsertPerson(Person p)
        {
            return perDb.InsertPerson(p);
        }

        public int DeletePerson(int id)
        {
            return perDb.DeletePerson(id);
        }

        public Person GetPerson(int id)
        {
            return perDb.GetPerson(id);
        }

        public Person GetPerson(string tlf)
        {
            return perDb.GetPerson(tlf);
        }

        public Member GetMember(int id)
        {
            return perDb.GetMember(id);
        }

        public int UpdatePerson(Person p)
        {
            return perDb.UpdatePerson(p);
        }
    }
}
